package net.atos.spring;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
public class BookService {

    @PersistenceContext(name = "application")
    EntityManager em;

    @Transactional
    public void save(Book book) {
	em.persist(book);
	em.flush();
    }
}
